package array

/**
索引缓冲数组到顶点缓冲数组的转换
 */
func IndicesToPoints(points []float32,indices []uint32,slicelen int32)[]float32{
	ps := points[:]
	indices_len := int32(len(indices))
	newpoints := make([]float32,0)
	var i,j int32
	for i = 0; i<indices_len;i++{
		key := int32(indices[i])
		newps := ps[slicelen*key:slicelen*(key+1)]
		for j = 0;j<slicelen;j++{
			newpoints = append(newpoints,newps[j])
		}
	}
	return newpoints
}